#pragma once
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<assert.h>


#ifndef GRAPH_H
#define GRAPH_H
#define NAMESIZE 20
#define INTROSIZE 100

typedef enum{ Success,OutMemory,ParaErr,ResultErr }ReturnStatus;
typedef unsigned int uint32;

typedef struct EdgeNode {
	uint32 adjvexindex;
	uint32 weight;
	struct EdgeNode* next;
}EdgeNode;
typedef struct Data {
	char name[NAMESIZE];
	char intro[INTROSIZE];
}Data;
typedef struct VertexNode {
	Data da;
	EdgeNode* firstedge;
}VertexNode;

typedef struct Graph {
	struct VertexNode* vertexable;
	uint32 curvertexnum;
	uint32 maxvertexnum;

}Graph;

ReturnStatus InitGraph(Graph* pg);
ReturnStatus InsertEdge(Graph* pg, const char* begin, const char* end, int weight);
void ShowGraph(Graph* gp);
void DistOnce(Graph* gp, const char* begin, const char* end,int mod);
void Destory(array);
void CreatGraph(Graph* pg);
void ShowShort(Graph* pg);
void Destory(Graph* pg);
void DistOnce(Graph* pg, const char* begin, const char* end, int mod);
void FindShort(Graph* pg);
void AddGraph(Graph* pg);
void AddVertexNode(Graph* pg, int n);
void AddEdge(Graph* pg);


#endif
